/*
 * @Author: szx
 * @Date: 2022-05-26 13:58:44
 * @LastEditTime: 2022-05-26 14:03:25
 * @Description:
 * @FilePath: \leetcode\面试题\10\10\10.js
 */
var StreamRank = function () {
    this.stack = [];
};

/**
 * @param {number} x
 * @return {void}
 */
StreamRank.prototype.track = function (x) {
    this.stack.push(x);
};

/**
 * @param {number} x
 * @return {number}
 */
StreamRank.prototype.getRankOfNumber = function (x) {
    return this.stack.filter((v) => v <= x).length;
};
